package com.zero.yygh.user.config;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author zero
 * @desc 微信登录接口参数
 * @create 2021/4/6
 */
@Component
public class ConstantPropertiesUtil implements InitializingBean {

    @Value("${wechat.open.app_id}")
    private String appId;

    @Value("${wechat.open.app_secret}")
    private String appSecret;

    @Value("${wechat.open.redirect_url}")
    private String redirectUrl;

    @Value("${yygh.baseUrl}")
    private String yyghBaseUrl;

    public static String WECHAT_OPEN_APP_ID;
    public static String WECHAT_OPEN_APP_SECRET;
    public static String WECHAT_OPEN_REDIRECT_URL;

    public static String YYGH_BASE_URL;


    @Override
    public void afterPropertiesSet () throws Exception {
        WECHAT_OPEN_APP_ID = appId;
        WECHAT_OPEN_APP_SECRET = appSecret;
        WECHAT_OPEN_REDIRECT_URL = redirectUrl;
        YYGH_BASE_URL = yyghBaseUrl;
    }
}
